﻿using NCS.IConnect.Core.Configuration;
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using System.Threading.Tasks;

namespace NCS.IConnect.Core.WebApi.Configuration
{
    /// <summary>
    /// The configuration section for iConnect.NET Web API.
    /// </summary>
    [ConfigurationSectionName(Constants.ConfigurationSections.WebApi)]
    [ComVisible(false)]
    public class WebApiSettings : ServiceLocatableSettings
    {
        private const string AuthorizationPropertyName = "authorization";
        private const string CacheControlPropertyName = "cacheControl";

        /// <summary>
        /// The authorization settings.
        /// </summary>
        [ConfigurationProperty(AuthorizationPropertyName,IsRequired = false)]
        public AuthorizationElement Authorization
        {
            get { return base[AuthorizationPropertyName] as AuthorizationElement; }
        }

        /// <summary>
        /// The cache control settings.
        /// </summary>
        [ConfigurationProperty(CacheControlPropertyName, IsRequired = false)]
        public CacheControlElement CacheControl
        {
            get { return base[CacheControlPropertyName] as CacheControlElement; }
        }
    }
}
